<!DOCTYPE html>
<html>
<head>

    {% include 'public/header.phtml' %}

    <title>Materia - Admin Template</title>

</head>
<body id="app" class="app off-canvas">


{% include 'public/top.phtml' %}


<!-- main-container -->
<div class="main-container clearfix">


    {% include 'public/left.phtml' %}
    <!-- content-here -->
    <div class="content-container" id="content">
        <div class="page page-forms-elements">

            <ol class="breadcrumb breadcrumb-small">
                <li>文章</li>
                <li class="active"><a href="forms.elements.html">修改</a></li>
            </ol>

            <div class="page-wrap">
                <!-- row -->
                <div class="row">

                    <!-- col-left -->
                    <div class="col-sm-12 col-md-10">
                        <div class="panel panel-default panel-hovered panel-stacked mb30">
                            <div class="panel-heading">
                                文章内容
                                <a href="/article/" class="btn btn-line-success btn-rounded waves-effect right btn-sm">返回列表</a>

                            </div>
                            <div class="panel-body">
                                <form role="form" class="form-horizontal myform" action="/article/doEdit" method="post"> <!-- form horizontal acts as a row -->
                                    <!-- normal control -->

                                    <input type="hidden" name="id" value="{{post.id}}">
                                    <div class="form-group">
                                        <label class="col-md-3 control-label">标题</label>
                                        <div class="col-md-9">
                                            {% if post %}

                                            <input type="text" name="title" class="form-control" value="{{post.title}}">
                                            {% else %}

                                            <input type="text" name="title" class="form-control">
                                            {% endif %}
                                        </div>
                                    </div>

                                    <!-- with hint -->
                                    <div class="form-group">
                                        <label class="col-md-3 control-label">关键词</label>
                                        <div class="col-md-9">
                                            {% if post.keywords %}

                                            <input type="text" name="keywords" class="form-control" placeholder="Key words" value="{{post.keywords}}">
                                            {% else %}

                                            <input type="text" name="keywords" class="form-control" placeholder="Key words">
                                            {% endif %}


                                            <p class="text-danger text-right xsmall">关键词之间用，隔开</p>
                                        </div>
                                    </div>

                                    <!-- author control -->
                                    <div class="form-group">
                                        <label class="col-md-3 control-label">作者</label>
                                        <div class="col-md-9">


                                            {% if post.author %}

                                            <input type="text" name="author" class="form-control"  value="{{post.author}}">
                                            {% else %}

                                            <input type="text" name="author" class="form-control" >
                                            {% endif %}

                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-md-3 control-label">应用ID</label>
                                        <div class="col-md-9">


                                            {% if post.appid %}

                                            <input type="text" name="appid" class="form-control" value="{{post.appid}}">
                                            {% else %}

                                            <input type="text" name="appid" class="form-control" >
                                            {% endif %}
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-md-3 control-label">URI</label>
                                        <div class="col-md-9">
                                            <input type="text" name="url" class="form-control" >

                                            {% if post.url %}

                                            <input type="text" name="url" class="form-control" value="{{post.url}}">
                                            {% else %}

                                            <input type="text" name="url" class="form-control" >
                                            {% endif %}
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-md-3 control-label">点击量</label>
                                        <div class="col-md-9">

                                            {% if post.hits %}

                                            <input type="text" name="hits" class="form-control" value="{{post.hits}}">
                                            {% else %}

                                            <input type="text" name="hits" class="form-control" >
                                            {% endif %}

                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-md-3 control-label">缩略图</label>
                                        <div class="col-md-9">

                                            {% if post.smeta %}

                                            <input type="text" name="smeta" class="form-control" value="{{post.smeta}}">
                                            {% else %}

                                            <input type="text" name="smeta" class="form-control" >
                                            {% endif %}

                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-md-3 control-label">是否显示</label>
                                        <div class="col-md-9">
                                            <div class="ui-radio ui-radio-pink">
                                                <label class="ui-radio-inline">
                                                    {% if post.isshow ==1%}
                                                        <input type="radio" checked name="isshow" value="1">
                                                        {% else %}
                                                        <input type="radio" name="isshow" value="1">

                                                    {% endif %}

                                                    <span>是</span>
                                                </label>
                                                <label class="ui-radio-inline">
                                                    {% if post.isshow == 0%}
                                                    <input type="radio" checked name="isshow" value="0">
                                                    {% else %}
                                                    <input type="radio" name="isshow" value="0">

                                                    {% endif %}

                                                    <span>否</span>
                                                </label>

                                            </div>
                                        </div>
                                    </div>


                                    <!-- textarea control -->
                                    <div class="form-group">
                                        <label class="col-md-3 control-label">描述</label>
                                        <div class="col-md-9">

                                            {% if post.desc %}

                                            <textarea rows="5" name="desc" class="form-control resize-v" >{{post.desc}}</textarea>
                                            {% else %}

                                            <textarea rows="5" name="desc" class="form-control resize-v" placeholder="Put something here"></textarea>
                                            {% endif %}


                                        </div>
                                    </div>

                                    <div class="form-group">

                                        <input type="hidden" name="content">
                                        <label class="col-md-3 control-label">内容</label>
                                        <div class="col-md-9">
                                            {% if post %}
                                                <script id="editor" type="text/plain" name="content" style="height:500px;">{{post.content}}</script>
                                            {% else %}
                                                <script id="editor" type="text/plain" name="content" style="height:500px;"></script>
                                            {% endif %}
                                        </div>
                                    </div>



                                    <div class="clearfix right">
                                        <button class="btn btn-primary mr5" id ="saveBtn" type="submit">保存</button>
                                        <button class="btn btn-default">Cancel</button>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div> <!-- #end col-left -->


                </div>
                <!-- #end row -->

            </div> <!-- #end page-wrap -->
        </div> <!-- #end page -->
    </div> <!-- #end content-container -->

</div> <!-- #end main-container -->


<!-- theme settings -->
<div class="site-settings clearfix hidden-xs">
    <div class="settings clearfix">
        <div class="trigger ion ion-settings left"></div>
        <div class="wrapper left">
            <ul class="list-unstyled other-settings">
                <li class="clearfix mb10">
                    <div class="left small">Nav Horizontal</div>
                    <div class="md-switch right">
                        <label>
                            <input type="checkbox" id="navHorizontal">
                            <span>&nbsp;</span>
                        </label>
                    </div>


                </li>
                <li class="clearfix mb10">
                    <div class="left small">Fixed Header</div>
                    <div class="md-switch right">
                        <label>
                            <input type="checkbox"  id="fixedHeader">
                            <span>&nbsp;</span>
                        </label>
                    </div>
                </li>
                <li class="clearfix mb10">
                    <div class="left small">Nav Full</div>
                    <div class="md-switch right">
                        <label>
                            <input type="checkbox"  id="navFull">
                            <span>&nbsp;</span>
                        </label>
                    </div>
                </li>
            </ul>
            <hr/>
            <ul class="themes list-unstyled" id="themeColor">
                <li data-theme="theme-zero" class="active"></li>
                <li data-theme="theme-one"></li>
                <li data-theme="theme-two"></li>
                <li data-theme="theme-three"></li>
                <li data-theme="theme-four"></li>
                <li data-theme="theme-five"></li>
                <li data-theme="theme-six"></li>
                <li data-theme="theme-seven"></li>
            </ul>
        </div>
    </div>
</div>
<!-- #end theme settings -->




<!-- Dev only -->
{% include 'public/footer.phtml' %}
<script src="<?=JS_PATH?>select2.min.js"></script>
<script src="<?=JS_PATH?>bootstrap-colorpicker.min.js"></script>
<script src="<?=JS_PATH?>bootstrap-slider.min.js"></script>
<script src="<?=JS_PATH?>summernote.min.js"></script>
<script src="<?=JS_PATH?>bootstrap-datepicker.min.js"></script>
<script src="<?=JS_PATH?>form-elements.init.js"></script>
<script type="text/javascript" charset="utf-8" src="<?=JS_PATH?>ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="<?=JS_PATH?>ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="<?=JS_PATH?>zh-cn.js"></script>


<script>

    var ue = UE.getEditor('editor');




</script>

</body>
</html>

